<template>
	<view class="CloudInteraction">
		<view :style="{'height': `${statusBarHeight}px`, 'background-color': '#060143'}"></view>
		<uni-nav-bar backgroundColor="#060143;" color="#FFF" :title="$t('language.meeting14')" @clickLeft="goBack" left-icon="left"
			:border="false" />
		<view class="logo">
			<image class="logo-ic" src="@/static/logo.png" alt="" />
			<view class="lang-wrap" @click="changeLanguage">
				<image src="../../static/100.png" mode=""></image>
				<text>{{$t('locale.lang')}}</text>
			</view>
		</view>
		<view class="VotingInfoHeader">
			<view class="VotingPadding">
				<view class="forList" v-for="(item,index) in ListBox" :key="index" @click="toInfo(item)">
					<view class="title">
						{{$t('language.name') == '中文'?item.title:item.e_title}}
					</view>
					<view class="time" v-if="item.add_time">
						{{item.add_time}} <uni-icons type="forward" size="14" color="#929295"></uni-icons>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		HTTP_REQUEST_URL
	} from '@/config/app';
	import uniIcons from "@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
	import {
		intro
	} from "@/api/user";
	export default {
		name: 'messageNoOpen',
		components: {
			uniIcons
		},
		data() {
			return {
				baseUrl: HTTP_REQUEST_URL,
				statusBarHeight: 44,
				title: '',
				e_title: '',
				evenId: '',
				imgSrc: '',
				ListBox: []
			}
		},
		created() {},
		onLoad(o) {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
			let evenId = o.evenId;
			this.evenId = evenId;
			this.getImg();
		},
		methods: {
			getImg() {
				intro({
					event_id: this.evenId,
				}).then(
					response => {
						if (response.code == 200) {
							this.ListBox = response.data;
							this.title = response.event.model;
							this.e_title = response.event.e_model;
						} else {
							uni.showToast({
								title: response.msg,
								icon: 'none'
							})
						}
					},
					err => {
						console.log(err)
					}
				);
			},
			toInfo(item) {
				uni.navigateTo({
					url: '/pages/indexBox/messageInfo?id=' + item.id + '&evenId=' + this.evenId
				})
			},
			goBack() {
				uni.navigateBack()
			},
			changeLanguage() {
				if (this.$i18n.locale == 'zh') {
					this.$i18n.locale = 'en';
					uni.setStorageSync('locale', 'en')
				} else {
					this.$i18n.locale = 'zh';
					uni.setStorageSync('locale', 'zh')
				}
			}
		}
	}
</script>
<style lang="scss">

	.logo {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20upx 30upx;
		background-color: #060143;

		.logo-ic {
			width: 78upx;
			height: 64upx;
		}

		.lang-wrap {
			display: flex;
			align-items: center;
			color: #fff;
			font-size: 24upx;

			image {
				width: 30upx;
				height: 30upx;
				margin-right: 12upx;
			}
		}
	}

	page {
		background-color: #050033;
	}

	.headerChangeLanguage {
		height: 100upx;
		background: #fff;
		padding: 0 30upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-shadow: 0 2upx 4upx #ccc;
		width: 100%;
		box-sizing: border-box;
	}

	.logo image {
		width: 178upx;
		height: 30upx;
	}


	.language {
		flex-shrink: 0;
	}

	.langeageZh {
		height: 30upx;
		width: 86upx;
		background: url($image-base-url + '/static/img/EN-17.png') no-repeat;
		background-size: 86upx 30upx;
	}

	.langeageEn {
		height: 30upx;
		width: 86upx;
		background: url($image-base-url + '/static/img/CH-17.png') no-repeat;
		background-size: 86upx 30upx;
	}

	.title {
		color: #d96932;
		font-size: 40upx;
		font-weight: bold;
	}

	.VotingInfoHeader {
		width: 100%;
		position: relative;
		box-sizing: border-box;
		padding: 0 20upx;
		margin-top: 28upx;
	}

	.forList {
		height: 170upx;
		background: #060143;
		border-radius: 8upx;
		margin-bottom: 30upx;
		padding: 24rpx 30rpx 0;
		position: relative;
	}

	.title {
		min-height: 90upx;
		color: #fff;
		font-size: 32upx;
	}

	.time {
		color: #959597;
		font-size: 24upx;
		height: 80upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 92%;
		position: absolute;
		bottom: 0;
	}

	.time image {
		width: 30upx;
		height: 30upx;
	}

	.listBox {
		width: 100%;
		border-bottom: 2upx solid #f6f5ef;
		padding: 20upx 0;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	.userCover {
		width: 150upx;
		height: 150upx;
	}

	.userCover image {
		width: 150upx;
		height: 150upx;
		border-radius: 4upx
	}

	.messageBox {
		display: flex;
		align-items: baseline;
		flex-wrap: wrap;
		padding-left: 30upx;
		height: 150upx;
		align-content: space-between
	}

	.userTitle {
		font-size: 32upx;
		font-weight: bold;
	}

	.userMessage {
		font-size: 24upx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
	}

	.messageBox view {
		width: 100%;
	}

	.formText {
		padding: 30upx;
	}

	.formText textarea {
		width: 100%;
		background: #f6f5ef;
		border: none;
		resize: none;
		box-sizing: border-box;
		padding: 30upx;
		height: 224upx;
		border-radius: 8upx;
	}

	.submitCloud {
		width: 100%;
		text-align: center;
		height: 80upx;
		line-height: 80upx;
		border-radius: 80upx;
		margin-top: 100upx;
		background: #d96932;
		color: #fff;
	}
</style>